<script setup>
import Nav from './nav.vue'
//父传子
//以数组的方式
const props=defineProps(["propsName","propsAge"])
console.log(props)


//子传父
const emits=defineEmits(["getUser","addAge"])
emits("getUser",{name:'fanhuiling',age:'20'})
const addAge=()=>{
    emits("addAge",18)
}

</script>

<template>
    <h3>Header.vue组件</h3>    
    <button @click="addAge">增加10年</button>


    <!-- 匿名插槽  slot-->
     <slot />
</template>

<style scoped>

</style>